/* Standard */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

/* Unix OS */
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>    
#include <dirent.h>

/* Network */
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>   /*sockaddr_in*/

#define CmdCount	10
#define InputBufSize	400
#define MessageBufferSize 1024

struct CommandMap
{
	char command[255];
	void (*process)();
};

void Prompt();
void PrintDir(char *path);
void ProcessError();
void ProcessCls();
void ProcessSls();
void ProcessCcd();
void ProcessScd();
void ProcessPut();
void ProcessGet();
void ProcessHelp();
void ProcessSpwd();
void ProcessExit();
void Preprocess();
void Dispatch();
void Dispart();
void ConnectHost();

extern struct CommandMap CmdMap[CmdCount];

extern char command[255], argu[255];
extern char ErrorMessage[255];
extern char InputBuf[InputBufSize]; /* Stores command and argument. */
extern char pMessageBuffer[];

extern char HostName[255];
extern int  PortNumber;
extern int  sockfd;
